package com.idea.relax.exception;

import com.hawk.eye.common.core.ApiResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

/**
 * @className: ServiceAlarmController
 * @description:
 * @author: salad
 * @date: 2023/9/30
 **/
@Slf4j
@RestController
@RequestMapping("/demo/service/")
@RequiredArgsConstructor
public class ServerController {


	/**
	 *
	 */
	@GetMapping(value = "/testApi")
	public ApiResult testApi() {
		System.out.println("testApi");
		return ApiResult.ok("testApi");
	}

	@GetMapping(value = "/testApiParams")
	public ApiResult testApiParams(String id, String name, Integer age) {
		System.out.println("testApiParams" + "-" + id + "-" + name + "-" + age);
		return ApiResult.ok("testApiParams");
	}

	@GetMapping(value = "/testApiParams2")
	public ApiResult testApiParams2(ServerReqVO reqVO) {
		System.out.println("testApiParams2:" +reqVO);
		return ApiResult.ok("testApiParams2");
	}

	/**
	 *
	 */
	@PostMapping(value = "/testApiPost")
	public ApiResult testApiPost() {
		System.out.println("testApiPost");
		return ApiResult.ok("testApiPost");
	}

}
